package com.westa.smallshop.data.source.remote;

import android.support.annotation.IntDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.List;

/**
 * Created by cy123 on 2016/9/12.
 */
public interface BaseDataSource<T> {

    int REFRESH = 1;

    int LOAD_MORE = 2;

    /**
     * @hide
     */
    @IntDef({LOAD_MORE, REFRESH})
    @Retention(RetentionPolicy.SOURCE)
    @interface LoadType {
    }

    interface LoadCallBack<T> {

        void onLoadDataSuccessful(T data);

        void onLoadDataFailed();
    }

    interface LoadListCallBack<T> {

        void onRefreshDataSuccessful(List<T> data);

        void onLoadMoreDataSuccessful(List<T> data);

        void onLoadDataFailed();
    }

    interface GetListCallBack<T> {

        void onGetDataSuccessful(List<T> data);

        void onGetDataFailed();
    }

    void cancelLoadRequest();
}
